# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=japa
pkgver=0.9.4
pkgrel=3
pkgdesc="A 'perceptual' or 'psychoacoustic' audio spectrum analyser"
arch=(loong64 x86_64)
url="https://kokkinizita.linuxaudio.org/linuxaudio/index.html"
license=(GPL-2.0-or-later)
groups=(pro-audio)
depends=(
  clxclient
  clthreads
  fftw
  gcc-libs
  glibc
  jack
  libx11
  zita-alsa-pcmi
)
source=(https://kokkinizita.linuxaudio.org/linuxaudio/downloads/$pkgname-$pkgver.tar.bz2)
sha512sums=('d4b8b2a28c40f3f0d798be77f425e679532898e6b6060992ee0e5e2fc7d30c5cf139ae100433164b7f69f7a0df9eb317901ffbf1a651573a464769eb9e9db805')
b2sums=('60cff0b3ddb4f1432a070a0bddbcf4293e578c56c2e39813fe9433281070954d006e44db053ac20e6586f07e08792f86069638f367b1167f33375e276494d85d')

prepare() {
  # disable optimizations
  sed -e '/native/d' -i $pkgname-$pkgver/source/Makefile
}

build() {
  make -C $pkgname-$pkgver/source
}

package() {
  make PREFIX=/usr DESTDIR="$pkgdir/" install -C $pkgname-$pkgver/source
  install -vDm 644 $pkgname-$pkgver/{AUTHORS,README} -t "$pkgdir/usr/share/doc/$pkgname/"
}
